package frsf.cidisi.exercise.proyectoia.situationcalculus.actions;

import frsf.cidisi.exercise.proyectoia.situationcalculus.StateMapa;
import frsf.cidisi.faia.agent.situationcalculus.SituationCalculusAction;
import frsf.cidisi.faia.state.AgentState;
import frsf.cidisi.faia.state.EnvironmentState;

public class IrNorte extends SituationCalculusAction {

    @Override
    public EnvironmentState execute(AgentState ast, EnvironmentState est) {
    	 
    	StateMapa environmentState =
                 (StateMapa) est;

         // Get the actual agent position
         int fila = environmentState.getAgentPosition()[0];
         int col = environmentState.getAgentPosition()[1];

   
         fila--;

         environmentState.setAgentPosition(new int[] {fila, col});
        
        return est;
    }

    @Override
    public String toString() {
        return "irNorte";
    }
}

